package demo1;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        MyThreadPool myThreadPool=MyThreadPool.createMyThreadPool(5);
        myThreadPool.submit(()->{
            System.out.println("任务1 "+"当前正在执行的线程: "+Thread.currentThread().getName());
        });
        myThreadPool.submit(()->{
            System.out.println("任务2 "+"当前正在执行的线程: "+Thread.currentThread().getName());
        });
        myThreadPool.submit(()->{
            System.out.println("任务3 "+"当前正在执行的线程: "+Thread.currentThread().getName());
        });
        myThreadPool.submit(()->{
            System.out.println("任务4 "+"当前正在执行的线程: "+Thread.currentThread().getName());
        });
        myThreadPool.submit(()->{
            System.out.println("任务5 "+"当前正在执行的线程: "+Thread.currentThread().getName());
        });

    }
}
